package com.ttl.bc.ap.paymoney.db;


import org.apache.struts.action.ActionForm;

import com.ttl.bc.ap.invoice.action.BCAPInvoice2Form;
import com.ttl.bc.ap.paymoney.bean.BCPayMoneyBean;
import com.ttl.common.util.CommonUtils;



public class BCPayMoneyBO {

	public static Object getObject(ActionForm form) {
		
		BCAPInvoice2Form invForm = (BCAPInvoice2Form)form; 
								
		BCPayMoneyBean pay = new BCPayMoneyBean();
		pay.setDocNo(invForm.getDocNo());
		pay.setDocDate(CommonUtils.convertStringToDate(invForm.getDocDate()));
		pay.setApCode(invForm.getApCode());				
		pay.setCurrencyCode(invForm.getCurrencyCode());					
		pay.setExchangeRate(Double.valueOf(invForm.getExchangeRate()));
		pay.setPayAmount(Double.valueOf(invForm.getPayAmount()));
							
		pay.setHomeAmount(Double.valueOf(invForm.getPayAmount()));
		pay.setChqTotalAmount(0.0);
		pay.setPaymentType(4);					
		pay.setSaveFrom(1);					
		pay.setPayChqState(0);
		pay.setLineNumber(0);					
		pay.setRefNo(invForm.getRefNo());
		
		pay.setBookNo("");
		pay.setBankCode("");
		pay.setBankBranchCode("");
		pay.setMyDescription("ซื้อเงินสด");
		pay.setProjectCode(invForm.getProjectCode());
		pay.setDepartCode(invForm.getDepartCode());				
						
		pay.setRefDate(CommonUtils.convertStringToDate( invForm.getDocDate()));				
					
		
		return pay;
	}
	

}
